package main

import (
	"crypto/md5"
	"encoding/hex"
	"fmt"
	"io"
	"os"
)

func main() {

	filePath := "C:\\Users\\asd\\Documents\\Tencent Files\\1193349248\\Image\\Group\\Image1\\%@4_7TK92)X7LG%A~`C7KF8.jpg"
	cp := "C:\\Users\\asd\\Documents\\Tencent Files\\1193349248\\Image\\Group\\Image1\\%@4_7TK92)X7LG%A~`C7KF8.png"

	fmt.Println(getMd5(filePath))
	fmt.Println(getMd5(cp))
}

func getMd5(path string) (value string) {
	file, err := os.Open(path)
	if err == nil {
		md5h := md5.New()
		_, _ = io.Copy(md5h, file)
		value = hex.EncodeToString(md5h.Sum([]byte("")))
	}
	return
}
